package com.aaa.sas.service;

import com.aaa.sas.dao.AccountDaotest;
import com.aaa.pojo.Pagesas;
import com.aaa.pojo.ResultBeansas;
import com.aaa.pojo.tbl_test_plan_sas;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountServicetestimpl implements AccountServicetest{
    @Autowired
    AccountDaotest accountDaotest;
    @Override
    public ResultBeansas findAll(Pagesas pagesas,tbl_test_plan_sas tbl_test_plan_sas) {
        PageHelper.startPage(pagesas.getPage(), pagesas.getLimit());

        //查数据

        List<tbl_test_plan_sas> list = accountDaotest.findAll(tbl_test_plan_sas);
        PageInfo<tbl_test_plan_sas> pageInfo=new PageInfo<tbl_test_plan_sas>(list);
        return new ResultBeansas(0,"查询成功",pageInfo.getTotal(),pageInfo.getList());
    }

    @Override
    public Integer deletes(@Param("id") Integer[] id) {
        return accountDaotest.deletes(id);
    }

    @Override
    public Integer save(tbl_test_plan_sas tbl_test_plan_sas) {
        return accountDaotest.save(tbl_test_plan_sas);
    }

    @Override
    public Integer delete(Integer id) {
        return accountDaotest.delete(id);
    }

    @Override
    public Integer update(tbl_test_plan_sas tbl_test_plan_sas) {
        return accountDaotest.update(tbl_test_plan_sas);
    }
}
